<?php 
	$list = $this->stactatics_info;
?>

<section class="grid_12">
	<div class="block-border"><form class="block-content form" id="table_form" method="post" action="">
		<h1>統計データ</h1>
		<div class="no-margin"><table class="table" cellspacing="0" width="100%">
		
			<thead>
				<tr>
					<th scope="col" rowspan="2">
						年ー月
					</th>
					<th scope="col" colspan="2">会議ブース</th>
					<th scope="col" colspan="2">会議室</th>
					<th scope="col" colspan="2">全部</th>
				</tr>
				<tr>
					<th scope="col">予約数（回）</th>
					<th scope="col">収入（VND）</th>
					<th scope="col">予約数（回）</th>
					<th scope="col">収入（VND）</th>
					<th scope="col">予約数（回）</th>
					<th scope="col">収入（VND）</th>
				</tr>
			</thead>
			
			<tbody>
				<?php if ($list):?>
					<?php foreach ($list as $key=>$row):?>
					<?php 
						$booth_data = $row ? $row[0] : array('order_count'=>0, 'revenue'=>0);
						@$meeting_room_data = $row[1] ? $row[1] : array('order_count'=>0, 'revenue'=>0);
					?>
					<tr>
						<td><?php echo $key?></td>
						<td><?php echo $booth_data['order_count']?></td>
						<td><?php echo $booth_data['revenue']?></td>
						<td><?php echo $meeting_room_data['order_count']?></td>
						<td><?php echo $meeting_room_data['revenue']?></td>
						<td><?php echo ($booth_data['order_count'] + $meeting_room_data['order_count'])?></td>
						<td><?php echo ($booth_data['revenue'] + $meeting_room_data['revenue'])?></td>
					</tr>
					<?php endforeach;?>
				<?php endif;?>
			</tbody>
		
		</table></div>
			
		<ul class="message no-margin">
			<li>統計データ</li>
		</ul>
	</form></div>
</section>